<div class="task">
<?php include ('buttons.tpl'); ?>
</div>
<?php if ($error) { ?>
<div class="warning"><?php echo $error; ?></div>
<?php } ?>
<h2><?php echo $heading_title; ?></h2>
<div class="description"><?php echo $heading_description; ?></div>
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
  <div id="tabs">
	<ul>
	  <li><a href="#tabs-1"><?php echo $tab_general; ?></a></li>
	</ul>
	<div id="tabs-1">
      <table>
        <tr>
          <td width="185"><span class="required">*</span> <?php echo $entry_name; ?></td>
          <td width="300"><input type="text" name="name" value="<?php echo $name; ?>" />
            <?php if ($error_name) { ?>
            <span class="error"><?php echo $error_name; ?></span>
            <?php  } ?></td>
        </tr>            
        <tr>
          <td valign="top"><?php echo $entry_access; ?></td>
          <td><?php echo $entry_all_access; ?><input name="all_access" onclick="$('input[name*=access]').attr('checked', this.checked);" type="checkbox"<?php echo (isset($all_access))?'checked="checked"':''?>><br />
          <div style="height:200px; overflow:auto;" class="overflow">
          <table width="100%">
	          <?php $j = 1; ?>
	          <?php foreach ($permissions as $permission) { ?>
	          <?php if($j != 1) {$j = 1;}else{$j = 0;} ?>
			  <?php if($j == 0) {$class = 'row1';}elseif($j == 1){$class = 'row2';}	?>
    		  <tr class="<?php echo $class; ?>" onmouseover="this.className='highlight'" onmouseout="this.className='<?php echo $class; ?>'">
              <?php if (!$permission['access']) { ?>
              <td><input name="access[]" type="checkbox" value="<?php echo $permission['name']; ?>" /></td>
              <td><?php echo $permission['name']; ?></td>
              <?php } else { ?>
              <td><input name="access[]" type="checkbox" value="<?php echo $permission['name']; ?>" checked="checked" /></td>
			  <td><?php echo $permission['name']; ?></td>
              <?php } ?>
            </tr>
            <?php } ?>
          </table>
          </div>
          </td>
        </tr>
        <tr>
          <td> </td>
          <td><hr /></td>
        </tr>
        <tr>
          <td valign="top"><?php echo $entry_modify; ?></td>
          <td><?php echo $entry_all_access; ?><input name="all_access" onclick="$('input[name*=modify]').attr('checked', this.checked);" type="checkbox"<?php echo (isset($all_access))?'checked="checked"':''?>><br />
          <div style="height:200px; overflow:auto;" class="overflow">
          <table width="100%">
	          <?php $j = 1; ?>
	          <?php foreach ($permissions as $permission) { ?>
	          <?php if($j != 1) {$j = 1;}else{$j = 0;} ?>
			  <?php if($j == 0) {$class = 'row1';}elseif($j == 1){$class = 'row2';}	?>
    		  <tr class="<?php echo $class; ?>" onmouseover="this.className='highlight'" onmouseout="this.className='<?php echo $class; ?>'">
              <?php if (!$permission['access']) { ?>
              <td><input name="modify[]" type="checkbox" value="<?php echo $permission['name']; ?>" /></td>
              <td><?php echo $permission['name']; ?></td>
              <?php } else { ?>
              <td><input name="modify[]" type="checkbox" value="<?php echo $permission['name']; ?>" checked="checked" /></td>
			  <td><?php echo $permission['name']; ?></td>
              <?php } ?>
            </tr>
            <?php } ?>
          </table>
          </div>
          </td>
        </tr>
      </table>
    </div>
  </div>
  <script type="text/javascript"><!--
	$(function() {
		$("#tabs").tabs();
	});
  //--></script>
</form>
